-
Notifications
You must be signed in to change notification settings - Fork 138
Add retry to StandardValueSet query to fix network errors #652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…forcedotcom/source-deploy-retrieve into ew/standard-value-set-connection-issues
command: | | ||
npm install shx -g | ||
shx rm -rf node_modules/@salesforce/source-deploy-retrieve | ||
working_directory: node_modules/@salesforce/source-tracking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a common thing to do for circular deps?
Does this not mean that for the tests source-tracking would be using the current version of SDR, but after deploy it'd be using whatever version it specifies in it's package.json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they're not circular, just transitive. plugin-source depends on SDR and STL and STL depends on SDR.
When we build the CLI, we bump both SDR and STL via yarn resolutions to their latest version.
This tests the changes on this branch everywhere that SDR is used. Imagine a bug in SDR that causes problems for STL, but you don't catch it because the nuts are using an STL with a different (bug-free) SDR. Wouldn't want to miss that!
|
||
if (error.lastError && error.lastError.message) { | ||
this.logger.debug(error.lastError.message); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a few unit tests to cover the conditions added here?
- retries and succeeds
- Hits the retry limit (seemed a bit like exercising the retry lib, but would be good to have a test to verify what happens when it hits the limit). Could just stub the failure condition early verse having to actually call until the lib fails.
- Not Retryable error thrown
It would make the unit testing a bit cleaner if you refactored the standardValueSetRecord
specific handling out into a method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some tests @gbockus-sf 👍
shiki "^0.10.1" | ||
|
||
typescript@^4.1.3, typescript@^4.4.3: | ||
typescript@^4.1.3, typescript@^4.4.3, typescript@^4.7.4: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like several of the deps are now out of sync with what's in @salesforce/dev-scripts
. Just verifying that's the way to go.
@iowillhoit I know these problems from the past. However, I have not seen this issue since api version 50. What error messages appear in the debug log? |
src/resolve/connectionResolver.ts
Outdated
throw err; | ||
} | ||
|
||
return result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you return the result from the try {} block, that would avoid the let
, the assignment, and possibly the await
@jayree Here are the two types of errors I am seeing:
Connection Reset:
|
QA NOTES:✅ : following instructions in post, generated manifest 5 times, no differences |
What does this PR do?
When running
force:source:manifest:create --fromorg
, thesingleRecordQuery
method to retrieveStandardValueSet
was having connection errors, added retry logic.What issues does this PR fix or reference?
@W-11303606@
Functionality Before
Connection errors would cause some queries to fail. The result was different package.xml file almos every time you ran
force:source:manifest:create --fromorg YOUR_ORG
package-xml-diffs-720.mov
Functionality After
Failed queries retry, the package.xml is the same every time
Testing
source-deploy-retreive
branchyarn build
yarn link
(if needed)plugin-source
yarn link @salesforce/source-deploy-retrieve
sfdx plugins:link .
git clone git@github.com:trailheadapps/dreamhouse-lwc.git dreamhouse-testing-standard-value-set
cd dreamhouse-testing-standard-value-set
sfdx force:org:create -s -d 1 -f config/project-scratch-def.json
sfdx force:source:manifest:create --fromorg THE_USERNAME
package.xml
git diff
to confirm not changes occur over multiple runsNow unlink everything! 🔥🔗